package data.email.comparator;

import data.Term;
import data.email.EmailStatistic;
import java.util.Comparator;

/**
 * Komparator untuk membantu rangking berdasarkan label to
 * @author Muqtafi Akhmad
 */
public class ToFieldComparator implements Comparator<Term> {

    public ToFieldComparator() {
    }

    @Override
    public int compare(Term o1, Term o2) {
        if (((EmailStatistic) o1.getStatistic()).getToWeight() < ((EmailStatistic) o2.getStatistic()).getToWeight()) {
            return 1;
        } else {
            return -1;
        }
    }
}
